import { createApp } from 'vue';
import App from '@/App.vue';
//引入antdesign Ui组件库
import Antd from "ant-design-vue";
//引入图标库
import * as antIcons from "@ant-design/icons-vue";
//引入引入antdesign ui样式
import "ant-design-vue/dist/reset.css";
//引入全局样式文件
import './style/index.scss';
//引入路由配置文件
import router from '@/router';
//引入pina
import pinia from "@/stores";
//引入pina持久化插件
import { createPersistedState } from "pinia-persistedstate-plugin";
//引入Svg插件注册
import "virtual:svg-icons-register";
//引入自定义插件
//引入自定义插件用来注册全局组件
import globalComponent from "@/plugins";
//引入前置路由
import './permission';
//引入自定义指令文件
import { hasPermission } from "@/permission/index";
//引入echarts
import echarts from "@/echart";

const persist = createPersistedState();
const app = createApp(App);
//注册图标组件
Object.keys(antIcons).forEach((key) => {
  app.component(key, antIcons[key]);
});

//注册自定义指令
hasPermission(app);
//安装自定义插件
app.use(globalComponent);
app.use(pinia);
app.use(echarts);
pinia.use(persist);
app.use(router);
app.use(Antd);
app.mount("#app");
